package com.finance.rule.export;

import com.finance.util.DateUtil;
import com.finance.util.export.ExcelHead;
import lombok.Data;

import java.text.ParseException;
import java.util.Date;

/**
 * Created by ljg on 2017/3/24.
 */
@Data
public class MixSectionParseBean {


    @ExcelHead(name = "供应商")
    private String supplierCodeImport;

    private String supplierCode;

    @ExcelHead(name = "配送类型")
    private String directionImport;

    private String direction;

    @ExcelHead(name = "左边界数值")
    private String pointLeft;

    @ExcelHead(name = "是否包含左边界")
    private String containLeftImport;

    private String containLeft;

    @ExcelHead(name = "右边界数字")
    private String pointRight;

    @ExcelHead(name = "是否包含右边界数字")
    private String containRightImport;

    private String containRight;

    @ExcelHead(name = "结算类型")
    private String settlementTypeImport;

    private String settlementType;

    @ExcelHead(name = "固定值")
    private String fixWeight;

    /**
     * 首件单价 单位元
     */
    @ExcelHead(name = "首件单价")
    private String firstPiecePrice;


    @ExcelHead(name = "拖件单价")
    private String secondPiecePrice;


    private String startTime;

    private String endTime;


    public Date convertStartTime() throws ParseException {
        if (this.startTime != null) {
            return DateUtil.str2date(this.startTime);
        }
        return null;
    }

    public Date convertEndTime() throws ParseException {
        if (this.endTime != null) {
            return DateUtil.str2date(this.endTime);
        }
        return null;
    }
}
